package io.github.wppli.domain.posts.model.valobj;

import com.fasterxml.jackson.annotation.JsonIgnore;
import io.github.wppli.domain.posts.model.entity.LikePostsEntity;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;

/**
 * @author li--jiaqiang 2025−03−11
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class PostsLikeCountVO implements Serializable {

    private Long postId;
    private Long userId;
    private UserPostsBehaviorType userPostsBehaviorType;
    private int adjustCount;

    @JsonIgnore
    public PostsLikeCountVO(LikePostsEntity likePostsEntity) {
        this.postId = likePostsEntity.getPostsId();
        this.userId = likePostsEntity.getUserId();
        this.adjustCount = likePostsEntity.getAdjustCount();
        this.userPostsBehaviorType = UserPostsBehaviorType.LIKE;
    }
}